<form class="layui-form  seller-alone-form" id="userAdd" style="padding:20px;height:auto;width: 3300px;">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>
            <a href="{:url('userSet')}" style="color: #428bca;font-weight:bold;" >费率设置</a> / Edit
        </legend>
    </fieldset>
    <br/>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" style="width: 150px;font-size: 18px;font-weight: bold;">最大建卡数：</label>
            <div class="layui-input-inline" style="width: 100px;font-size: 16px;">
                <input type="text" name="max_card"
                       value="{$max_card}" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="width: 200px;font-size: 18px;font-weight: bold;">0验证：</label>
            <div class="layui-input-inline" style="width: 100px;font-size: 16px;">
                <input type="text" name="zero_auth"
                       value="{$zero_auth}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" style="width: 150px;font-size: 18px;font-weight: bold;">declined(普通)：</label>
            <div class="layui-input-inline" style="width: 100px;font-size: 16px;">
                <input type="text" name="declined"
                       value="{$declined}" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="width: 200px;font-size: 18px;font-weight: bold;">declined(facebook)：</label>
            <div class="layui-input-inline" style="width: 100px;font-size: 16px;">
                <input type="text" name="facebook"
                       value="{$facebook}" class="layui-input">
            </div>
        </div>
    </div>
    <hr class="layui-bg-green">
    {foreach $list as $k=>$v}
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 100px;font-size: 18px;font-weight: bold;">银行-卡头：</label>
                <div class="layui-input-inline" style="width: 90px;font-size: 16px;">
                    <input type="text" style="border: 0px" readonly value="{$v.bank_type}_{$v.card_type}" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 90px;font-size: 18px;font-weight: bold;">开卡费：</label>
                <div class="layui-input-inline" style="width: 120px;font-size: 16px;">
                    <input type="text" name="{$v.bank_type}_{$v.card_type}_open_amount"
                           value="{$v.open_amount}" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px;font-size: 18px;font-weight: bold;">充值手续费：</label>
                <div class="layui-input-inline" style="width: 120px;font-size: 16px;">
                    <input type="text" name="{$v.bank_type}_{$v.card_type}_rate_fund"
                           value="{$v.rate_fund}" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px;font-size: 18px;font-weight: bold;">退款手续费：</label>
                <div class="layui-input-inline" style="width: 120px;font-size: 16px;">
                    <input type="text" name="{$v.bank_type}_{$v.card_type}_rate_refund"
                           value="{$v.rate_refund}" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px;font-size: 18px;font-weight: bold;">消费手续费：</label>
                <div class="layui-input-inline" style="width: 120px;font-size: 16px;">
                    <input type="text" name="{$v.bank_type}_{$v.card_type}_rate_tran"
                           value="{$v.rate_tran}" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px;font-size: 18px;font-weight: bold;">是否停用：</label>
                <div class="layui-input-inline seller-inline-3" style="width: 120px;font-size: 16px;">
                    <select name="{$v.bank_type}_{$v.card_type}_is_used" lay-verify="" >
                        <option value="0" {if $v.is_used ==0}selected{/if}>不停用</option>
                        <option value="1" {if $v.is_used ==1}selected{/if}>停用</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px;font-size: 18px;font-weight: bold;">是否推荐：</label>
                <div class="layui-input-inline seller-inline-3" style="width: 120px;font-size: 16px;">
                    <select name="{$v.bank_type}_{$v.card_type}_is_refe" lay-verify="" >
                        <option value="0" {if $v.is_refe ==0}selected{/if}>不推荐</option>
                        <option value="1" {if $v.is_refe ==1}selected{/if}>推荐</option>
                    </select>
                </div>
            </div>
        </div>
        <hr class="layui-bg-red">
        <br />
    {/foreach}
    <input type="hidden" name="set_id" value="{$set_id}">
    <div class="layui-form-item" style="padding-top: 100px;">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" lay-submit lay-filter="save">confirm</button>
            <a href="{:url('userSet')}" class="layui-btn layui-btn-primary">{:lang('back')}</a>
        </div>
    </div>
</form>

<script>
    layui.use(['form'], function () {
        var form = layui.form;

        form.on('submit(save)', function(data){
            JsPost("{:url('cardSet')}", data.field, function(res){
                if (res.code > 0) {
                    layer.msg(res.msg, {time: 1500, icon: 1}, function () {
                        window.location.href = "{:url('userSet')}";
                    });
                } else {
                    layer.msg(res.msg, {time: 1500, icon: 2});
                }
            });
        });
    });
</script>
